Optimal. Leaf size=140 \[ \frac {2 \sqrt {a} c^3 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a c^3 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^2 c^3 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac {2 a^3 c^3 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3989, 3972,
308, 209} \begin {gather*} -\frac {2 a^3 c^3 \tan ^5(e+f x)}{5 f (a \sec (e+f x)+a)^{5/2}}+\frac {2 a^2 c^3 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}+\frac {2 \sqrt {a} c^3 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}-\frac {2 a c^3 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 308
Rule 3972
Rule 3989
Rubi steps
\begin {align*} \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))^3 \, dx &=-\left (\left (a^3 c^3\right ) \int \frac {\tan ^6(e+f x)}{(a+a \sec (e+f x))^{5/2}} \, dx\right )\\ &=\frac {\left (2 a^4 c^3\right ) \text {Subst}\left (\int \frac {x^6}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {\left (2 a^4 c^3\right ) \text {Subst}\left (\int \left (\frac {1}{a^3}-\frac {x^2}{a^2}+\frac {x^4}{a}-\frac {1}{a^3 \left (1+a x^2\right )}\right ) \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac {2 a c^3 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^2 c^3 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac {2 a^3 c^3 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}}-\frac {\left (2 a c^3\right ) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} c^3 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a c^3 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^2 c^3 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac {2 a^3 c^3 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.24, size = 111, normalized size = 0.79 \begin {gather*} \frac {c^3 \left (30 \text {ArcTan}\left (\sqrt {-1+\sec (e+f x)}\right ) \cos ^2(e+f x)+(-29+22 \cos (e+f x)-23 \cos (2 (e+f x))) \sqrt {-1+\sec (e+f x)}\right ) \sec ^2(e+f x) \sqrt {a (1+\sec (e+f x))} \tan \left (\frac {1}{2} (e+f x)\right )}{15 f \sqrt {-1+\sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(301\) vs.
\(2(124)=248\).
time = 0.24, size = 302, normalized size = 2.16
method | result | size |
default | \(-\frac {c^{3} \sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \left (15 \sin \left (f x +e \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \left (\cos ^{2}\left (f x +e \right )\right ) \sqrt {2}+30 \sin \left (f x +e \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \cos \left (f x +e \right ) \sqrt {2}+15 \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \sin \left (f x +e \right )-184 \left (\cos ^{3}\left (f x +e \right )\right )+272 \left (\cos ^{2}\left (f x +e \right )\right )-112 \cos \left (f x +e \right )+24\right )}{60 f \sin \left (f x +e \right ) \cos \left (f x +e \right )^{2}}\) | \(302\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.93, size = 376, normalized size = 2.69 \begin {gather*} \left [\frac {15 \, {\left (c^{3} \cos \left (f x + e\right )^{3} + c^{3} \cos \left (f x + e\right )^{2}\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, {\left (23 \, c^{3} \cos \left (f x + e\right )^{2} - 11 \, c^{3} \cos \left (f x + e\right ) + 3 \, c^{3}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{15 \, {\left (f \cos \left (f x + e\right )^{3} + f \cos \left (f x + e\right )^{2}\right )}}, -\frac {2 \, {\left (15 \, {\left (c^{3} \cos \left (f x + e\right )^{3} + c^{3} \cos \left (f x + e\right )^{2}\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + {\left (23 \, c^{3} \cos \left (f x + e\right )^{2} - 11 \, c^{3} \cos \left (f x + e\right ) + 3 \, c^{3}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{15 \, {\left (f \cos \left (f x + e\right )^{3} + f \cos \left (f x + e\right )^{2}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - c^{3} \left (\int 3 \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )}\, dx + \int \left (- 3 \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{3}{\left (e + f x \right )}\, dx + \int \left (- \sqrt {a \sec {\left (e + f x \right )} + a}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 263 vs.
\(2 (124) = 248\).
time = 1.35, size = 263, normalized size = 1.88 \begin {gather*} -\frac {\frac {15 \, \sqrt {-a} a c^{3} \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right ) \mathrm {sgn}\left (\cos \left (f x + e\right )\right )}{{\left | a \right |}} + \frac {2 \, {\left (15 \, \sqrt {2} a^{3} c^{3} \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) + {\left (37 \, \sqrt {2} a^{3} c^{3} \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 40 \, \sqrt {2} a^{3} c^{3} \mathrm {sgn}\left (\cos \left (f x + e\right )\right )\right )} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2}\right )} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a\right )}^{2} \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}}}{15 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^3 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________